<%@page import="org.soenea.doitall.domain.model.user.IUser"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Login User - Successful</title>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/button.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/main.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/MainMenu.css" />
</head>
	<body>
		<h2>Login User Successful</h2>
		
		<c:if test="${!empty warning}">
			<b>Warning: </b> ${warning}<br />
		</c:if>
		<c:if test="${param['error']=='usermodified'}">
			<b>Warning: </b> Your user has been modified by another user. The updated information is shown below.<br />
		</c:if>
		<c:if test="${param['error']=='useringroup'}">
			<b>Warning: </b> You are already part of a group. You cannot create a new group.<br />
		</c:if>
		
		<div id="navbar"> 
		  <ul> 
			<li><a href="${pageContext.request.contextPath}/servlet/app/browsegroups">View Groups</a></li> 
			<c:if test="${user.groupID>0}">
			<li><a href="${pageContext.request.contextPath}/servlet/app/viewgroup">My Group</a></li> 
			</c:if>
			<c:if test="${user.groupID==0}">
			<li><a href="${pageContext.request.contextPath}/servlet/app/browseinvite">View Invites</a></li>
			</c:if>
			<li><a href="${pageContext.request.contextPath}/servlet/app/logout">Logout</a></li> 
		  </ul> 
		</div> 
		
		${user.firstName} ${user.lastName} is in group ${user.groupID}.
		<br/>
		<br/>
		
		<c:if test="${user.groupID==0}">
			<a href="${pageContext.request.contextPath}/servlet/app/browseinvite">VIEW INVITES </a><br/>
			
			<h2>Create Group</h2>
			<form method="POST" action="${pageContext.request.contextPath}/servlet/app/creategroup?version=${user.version}">	
				<label>Name: </label><input type="text" name="name" ><br>
				<label>Description: </label><input type="text" name="description"><br>
				<input type="submit" value="Create group" /><br>
			</form>				
		</c:if>			
	</body>
</html>